package com.qijian.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qijian.system.domain.UserExtra;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * 用户额外信息Mapper接口
 *
 * @author qijian
 * @date 2024-07-31
 */
public interface UserExtraMapper extends BaseMapper<UserExtra> {

    @Select("select count(0) from sys_user_extra WHERE create_time >= CURRENT_DATE ")
    int countCurrentDateWithDel();

    @Update("update sys_user_extra set client_id = null  where user_id !=#{userId} and client_id = #{clientId} ")
    void resetClientId(@Param("userId") Long userId, @Param("clientId") String clientId);
}
